package io.github.codelifeleno.jdbrelease.config;


import java.util.Objects;
import java.util.StringJoiner;

/**
 * 多行注释的配置
 */
public class Block {
    /**
     * 注释开头
     */
    private String start = "/*";
    /**
     * 注释结束符
     */
    private String end = "*/";


    @Override
    public String toString() {
        return new StringJoiner(", ", Block.class.getSimpleName() + "[", "]")
                .add("start='" + start + "'")
                .add("end='" + end + "'")
                .toString();
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;

        Block block = (Block) o;
        return Objects.equals(getStart(), block.getStart()) && Objects.equals(getEnd(), block.getEnd());
    }

    @Override
    public int hashCode() {
        int result = Objects.hashCode(getStart());
        result = 31 * result + Objects.hashCode(getEnd());
        return result;
    }

    public String getStart() {
        return start;
    }

    public void setStart(String start) {
        this.start = start;
    }

    public String getEnd() {
        return end;
    }

    public void setEnd(String end) {
        this.end = end;
    }

    public Block() {
    }

    public Block(String start, String end) {
        this.start = start;
        this.end = end;
    }
}
